package com.itcast.n3_类的加载器;

import jdk.nashorn.internal.runtime.ScriptEnvironment;

/**
 * @program: jvm
 * @description: -Djava.ext.dirs=D:\Java\jdk1.8.0_45\jre\lib\ext;E:\code\flyduck-note\jvm\jar
 * @author: flyduck
 * @create: 2024-09-03 13:40
 **/
public class Test05_使用参数让扩展类加载器加载自定义jar {
    public static void main(String[] args) throws ClassNotFoundException {
        Class<?> clazz = Class.forName("com.itheima.my.A");
        System.out.println("clazz = " + clazz);
        ClassLoader classLoader1 = clazz.getClassLoader();
        System.out.println("A类的类加载器 = " + classLoader1);//sun.misc.Launcher$ExtClassLoader@1c6b6478

        ClassLoader classLoader2 = ScriptEnvironment.class.getClassLoader();
        System.out.println("ScriptEnvironment类的类加载器 = " + classLoader2);//sun.misc.Launcher$ExtClassLoader@1c6b6478


    }
}
